/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Gestores;

import Datos.CantonDB;
import Datos.DefuncionDB;
import Negocio.Canton;
import Negocio.Defuncion;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Dvid
 */
public class GestorDefuncion {
     public int grabar(Defuncion defuncion) {
        try {
            DefuncionDB defuncionDB = new DefuncionDB();
            defuncionDB.grabar(defuncion);
            return 0;
        } catch (SQLException ex) {
            return 1;
        }}

    public Defuncion buscar(String id) {
       Defuncion aux=null;
        try {
            
            DefuncionDB defuncionDB = new DefuncionDB();
            aux = defuncionDB.buscar(id);
            aux.setNumero(aux.getNumero());
            aux.setCanton(aux.getCanton());
            aux.setCausa(aux.getCausa());
            aux.setFecha(aux.getFecha());
            aux.setPersona(aux.getPersona());
           
        return aux;
        } catch (SQLException ex) {
            Logger.getLogger(Canton.class.getName()).log(Level.SEVERE, null, ex);
            return aux;
        }
    }
}
